home *** CD-ROM | disk | FTP | other *** search
/ The Multimedia Yearbook 1964 / The Multimedia Yearbook 1964.iso / vfw / setup.mst < prev    next >
Text File  |  1995-07-24  |  11KB  |  307 lines

  1. '**************************************************************************
  2. '*                  VfW 1.1 Runtime Setup
  3. '**************************************************************************
  4. '$INCLUDE 'setupapi.inc'
  5. '$INCLUDE 'mscpydis.inc'    ''System
  6. '$INCLUDE 'msdetect.inc'    ''Detects Avalilable Disk Space
  7.  
  8. ''Dialog ID's
  9. CONST WELCOME       = 100
  10. CONST ASKQUIT       = 200
  11. CONST EXITFAILURE   = 400
  12. CONST EXITQUIT      = 600
  13. CONST EXITSUCCESS   = 700
  14. CONST APPHELP       = 900
  15. CONST CHECK         = 2500
  16. CONST SMALLWIN      = 2200
  17. CONST RESTART       = 2600
  18. CONST RESTARTII     = 2700
  19.  
  20. ''Bitmap ID
  21. CONST LOGO = 1
  22.  
  23. GLOBAL SizeReq&  '' Total Disk Size required for installation
  24.  
  25. ''File Types
  26. GLOBAL WinDir$
  27. GLOBAL WinSysDir$
  28. GLOBAL WinSys32Dir$
  29. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  30. GLOBAL CHECKSTATES$
  31. GLOBAL MinorVer%
  32. GLOBAL OnNT$
  33.  
  34. DECLARE SUB Install
  35. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  36. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  37. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  38. DECLARE SUB Reboot LIB "iniupd.dll"
  39. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  40.  
  41. INIT:
  42.   
  43.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  44.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  45.     
  46.     WIN32ENABLED% = 0
  47.     MajorVer% = GetWindowsMajorVersion()
  48.     MinorVer% = GetWindowsMinorVersion()
  49.     Processor% = GetProcessorType()
  50.     WinDir$ = GetWindowsDir()
  51.     DEST$ = GetWindowsDir()
  52.     WinSysDir$ = GetWindowsSysDir()
  53.     WinSys32Dir$ = WinDir$ + "system32"
  54.  
  55.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  56.     i% = DoMsgBox("Microsoft Windows version 3.10 or greater is required for this software.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  57.     END
  58.     END IF
  59.  
  60.     'Prevents installation on 286
  61.     IF Processor% < 3 THEN
  62.     i% = DoMsgBox("Video for Windows requires a 386 or greater processor or emulator.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  63.     END
  64.     END IF
  65.  
  66.     ' Use Wowexec to determine version of NT.  3.1 did not stamp wowexec and wow returns 3.1 as version
  67.     IF OnWindowsNT() THEN
  68.       OnNT$ = "TRUE"
  69.       WowVersion$ = GetVersionOfFile(WinSys32Dir$ + "\wowexec.exe")
  70.       IF WowVersion$ = "" THEN
  71.          i% = DoMsgBox("Video for Windows does not run on Windows NT 3.1.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  72.          END
  73.       END IF
  74.     END IF
  75.  
  76.     SetBitmap CUIDLL$, LOGO
  77.     SetTitle "Multimedia Yearbook"
  78.  
  79.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  80.     IF szInf$ = "" THEN
  81.        szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  82.     END IF
  83.     ReadInfFile szInf$
  84.  
  85.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  86.  
  87. WELCOME:
  88.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
  89.     IF sz$ = "CONTINUE" THEN
  90.        UIPop 1
  91.      ELSE
  92.     GOSUB ASKQUIT
  93.     GOTO WELCOME
  94.     END IF
  95.  
  96. ''Prepare Copy list and check size
  97.  
  98.     ClearCopyList
  99.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  100.  
  101. ''  Runtime files (on Windows disk)
  102. ''  Do not install OLE or MPlayer if on next release of NT or Windows
  103.  
  104.     IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN                   'These files not necessary on Windows NT
  105.     AddSectionFilesToCopyList "MPlayer", SrcDir$, WinDir$
  106.     AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  107.     END IF
  108.     AddSectionFilesToCopyList "VfW Runtime", SrcDir$, WinSysDir$
  109.     AddSectionFilesToCopyList "ACM Drivers", SrcDir$, WinSysDir$
  110.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  111.     IF OnNT$ = "TRUE" THEN
  112.     AddSectionFilesToCopyList "NT MSVideo", SrcDir$, WinSys32Dir$
  113.     ENDIF
  114. ''*************************************************************************************************************************
  115. ''*************************************************************************************************************************
  116. ''To add a DCI provider, please un-comment the AddSectionFilesToCopyList,
  117. ''and add a "DCI Provider" section with to the SETUP.INF file.
  118. ''
  119. ''      AddSectionFilesToCopyList "DCI Provider", SrcDir$, WinSysDir$
  120. ''*************************************************************************************************************************
  121. ''*************************************************************************************************************************
  122.  
  123.     AddSectionFilesToCopyList "WaveMix", SrcDir$, WinDir$
  124.  
  125. ''  Check windrive diskspace
  126.     SizeReq& = GetCopyListCost ("","", "")
  127.     IF SizeReq& <> 0 THEN
  128.     GOSUB SMALLWIN
  129.     END
  130.     END IF
  131.  
  132. Install
  133.  
  134. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  135. '' else, it gives the user the choice
  136.     RESTRT% = RestartListEmpty ()
  137.     Exe$ = DEST$ + "\_msrstrt.exe"
  138.     Batch$ = DEST$ + "\_mssetup.bat"
  139.     empty$ = ""
  140. RESTART:
  141.     IF RESTRT% = 0 THEN
  142.        sz$ = UIStartDlg(CUIDLL$, RESTART, "FInfo0DlgProc", 0, "")
  143.        IF sz$ = "REACTIVATE" THEN
  144.       GOTO RESTART
  145.        ENDIF
  146.        I% = ExitExecRestart ()
  147.        RemoveFile Exe$, cmoForce
  148.        RemoveFile Batch$, cmoForce
  149.        END
  150.     ELSE
  151.        sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
  152.        IF sz$ = "CONTINUE" THEN
  153.       I% = ExitWindowsExec (Exe$, empty$)
  154.       IF I% = 0 THEN
  155.          GOTO RESTART
  156.       ELSE
  157.          END
  158.      ENDIF
  159.        ELSEIF sz$ = "EXIT" THEN
  160.       UIPopAll
  161.       END
  162.        ELSEIF sz$ = "REACTIVATE" THEN
  163.       GOTO RESTART
  164.        ELSE
  165.       UIPop 1
  166.        END IF
  167.     END IF
  168.  
  169.  
  170. QUIT:
  171.     ON ERROR GOTO ERRQUIT
  172.  
  173.     IF ERR = 0 THEN
  174.     dlg% = EXITSUCCESS
  175.     ELSEIF ERR = STFQUIT THEN
  176.     dlg% = EXITQUIT
  177.     ELSE
  178.     dlg% = EXITFAILURE
  179.     END IF
  180. QUITL1:
  181.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  182.     IF sz$ = "REACTIVATE" THEN
  183.     GOTO QUITL1
  184.     END IF
  185.     UIPop 1
  186.     END
  187.  
  188. ERRQUIT:
  189.     i% = DoMsgBox("An installation problem occured, call the product support service", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  190.     END
  191.  
  192.  
  193. ASKQUIT:
  194.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  195.  
  196.     IF sz$ = "EXIT" THEN
  197.     UIPopAll
  198. ''        ERROR STFQUIT
  199.     END
  200.     ELSEIF sz$ = "REACTIVATE" THEN
  201.     GOTO ASKQUIT
  202.     ELSE
  203.     UIPop 1
  204.     END IF
  205.     RETURN
  206.  
  207. SMALLWIN:
  208.     sz$ = UIStartDlg(CUIDLL$, SMALLWIN, "FInfo0DlgProc", 0, "")
  209.     IF sz$ = "REACTIVATE" THEN
  210.     GOTO SMALLWIN
  211.     END IF
  212.     UIPop 1
  213.     RETURN
  214.  
  215. '**
  216. '** Purpose:
  217. '**     Performs all installation operations.
  218. '** Arguments:
  219. '**     none.
  220. '** Returns:
  221. '**     none.
  222. '*************************************************************************
  223. SUB Install STATIC
  224.  
  225.     SetRestartDir WinDir$
  226.     CopyFilesInCopyList
  227.  
  228. '' Yearbook
  229.     CreateProgmanGroup "Multimedia Yearbook", "", cmoOverwrite
  230.     ShowProgmanGroup  "Multimedia Yearbook", 1, cmoOverwrite
  231.     ini$ = MID$ (GetSymbolValue("STF_SRCDIR"), 1, 1)
  232.     CreateProgmanItem "Multimedia Yearbook", "Multimedia Yearbook", ini$ + ":\yb\yearbook.exe", "", cmoOverwrite
  233.     CreateProgmanItem "Multimedia Yearbook", "JMP Catalog", ini$ + ":\cat\jascat.exe", "", cmoOverwrite
  234.  
  235.  
  236. ''Updating WIN.INI and SYSTEM.INI
  237. ''Only update SYSTEM.INI  on NT or next version of Windows for other codecs
  238.  
  239. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  240.     IF VflatdPresent() = 0 THEN
  241.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  242.     END IF
  243. END IF
  244.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID", "iccvid.drv", cmoOverwrite
  245.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MSVC", "msvidc.drv", cmoOverwrite
  246.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  247.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "IR32.dll", cmoOverwrite
  248.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.MRLE", "MSRLE.drv", cmoOverwrite
  249.     I% = DoesIniKeyExist ("system.ini", "Drivers", "VIDC.RT21")
  250.     IF I% = 0  THEN
  251.        CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21_r.dll", cmoOverwrite
  252.     END IF
  253.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "ir21_r.dll", cmoOverwrite
  254.     CreateIniKeyValue WinDir$ + "WIN.INI", "mci extensions", "avi", "AVIVideo", cmoOverwrite
  255.     CreateIniKeyValue WinDir$ + "system.ini", "mci", "AVIVideo", "mciavi.drv", cmoOverwrite
  256.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "WaveMapper", "msacm.drv", cmoOverwrite
  257.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.msadpcm", "msadpcm.acm", cmoOverwrite
  258.     CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "MSACM.imaadpcm", "imaadpcm.acm", cmoOverwrite
  259.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msacm.drv", "Microsoft Sound Mapper V2.00", cmoOverwrite
  260.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "msadpcm.acm", "Microsoft ADPCM Codec V2.00", cmoOverwrite
  261.     CreateIniKeyValue WinDir$ + "control.ini", "drivers.desc", "imaadpcm.acm", "Microsoft IMA ADPCM Codec V2.00", cmoOverwrite
  262.  
  263. ''*************************************************************************************************************************
  264. ''*************************************************************************************************************************
  265. ''To add a DCI provider, please un-comment the UDH line, and un-comment and replace the <provider> with your own file name
  266. ''
  267. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "DCI", "<provider>", cmoOverwrite
  268. ''  CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "vids.draw", "udh.dll", cmoOverwrite
  269. ''*************************************************************************************************************************
  270. ''*************************************************************************************************************************
  271.  
  272. ''Do not register components not installed with Video for Windows on NT or next version of Windows.
  273. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  274.     Run ("regedit.exe /s " + MakePath(WinDir$, "mplayer.reg"))
  275.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "OLE2.reg"))
  276.     Run ("regedit.exe /s " + MakePath(WinSysDir$, "cleanup.reg"))
  277.  
  278. '' Mplayer
  279.     CreateProgmanItem "Accessories", "Media Player", MakePath(WinDir$, "mplayer.exe"), "", cmoOverwrite
  280.  
  281. END IF  ''NT and next version of Windows installation stop here.
  282.  
  283.     Run ("profdisp.exe")   
  284. END SUB
  285.  
  286. '**
  287. '** Purpose:
  288. '**     Appends a file name to the end of a directory path,
  289. '**     inserting a backslash character as needed.
  290. '** Arguments:
  291. '**     szDir$  - full directory path (with optional ending "\")
  292. '**     szFile$ - filename to append to directory
  293. '** Returns:
  294. '**     Resulting fully qualified path name.
  295. '*************************************************************************
  296. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  297.     IF szDir$ = "" THEN
  298.     MakePath = szFile$
  299.     ELSEIF szFile$ = "" THEN
  300.     MakePath = szDir$
  301.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  302.     MakePath = szDir$ + szFile$
  303.     ELSE
  304.     MakePath = szDir$ + "\" + szFile$
  305.     END IF
  306. END FUNCTION
  307.